﻿@model TelerikConnect.Web.Edit.TextUpdateModel

<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<link href="~/Content/styles/kendo.common.min.css" rel="stylesheet" />
<link href="~/Content/styles/kendo.default.min.css" rel="stylesheet" />
<link href="~/Content/styles/kendo.metro.min.css" rel="stylesheet" />

<div id="text-update">

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)

        <div class="editor-label">
            <label for="Content">New Value</label>
        </div>
        <div class="editor-field">
            <input class="text-box single-line k-input" id="Content" name="Content" type="text" value="">
            @Html.ValidationMessageFor(model => model.Content)
        </div>

        <p>
            <input type="submit" class="k-button" value="Update" />
        </p>
    }
</div>

<script>
    $form = $('form');
    $form.submit(function () {
        $.post($(this).attr('action'), $(this).serialize(), function (response) {
            document.getElementById("text-update").innerHTML = "Attribute was updated!";
        }, 'json');
        return false;
    });
</script>